package com.cn.api;

import com.cn.dto.LoginParams;
import com.cn.dto.Permission;
import com.cn.dto.UserDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
@Primary
@FeignClient(value = "user-client")
public interface UserService {
    @GetMapping("/user/update")
    int update(@RequestParam("UserDto") UserDto userDto);
    @PostMapping("/user/insert")
    int insert(@RequestParam("UserDto") UserDto userDto);
    List<Permission> getPermissionsByUserId(Integer id);
    @PostMapping("/user/status")
    int status(@RequestParam("id") int id);
    @GetMapping("/user/findById")
    UserDto findById(@RequestParam("id") int id);
    int delete(int id);
    @GetMapping("/user/findAll")
    List<UserDto> findAll(@RequestParam("limit") int limit, @RequestParam("page") int page);
    @GetMapping("/user/getByName")
    UserDto getByName(@RequestParam("username") String username);
    @PostMapping("/user/login")
    UserDto login(@RequestParam("LoginParams") LoginParams loginParams);
}
